/*
package NiuKe;

import java.util.Locale;
import java.util.Scanner;

*/
/**
 * @Description:
 * @Author: Hanzao
 * @Date: 2022/06/12/15:15
 *//*

public class HJ2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine().toUpperCase();
        Character next = scanner.next().toUpperCase().charAt(0);
        int res = 0;
        for(int i=0;i<s.length();i++){
            if(s.charAt(i) == next){
                res++;
            }
        }
        System.out.println(res);
    }
}
*/
